/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package assignment2;

/**
 * Inventory Class:
 * Used as the superclass for all Inventory Items
 * @author Vale
 *
 */
public class Inventory {

    public int invRequired;
    private int invStock;
    private String invUnits;
    private String invName;
    private int invQuality;
    private double invCost;
    private static final String QUAL_VGOOD = "Very Good";
    private static final String QUAL_GOOD = "Good";
    private static final String QUAL_AVG = "Average";
    private static final String QUAL_POOR = "Poor";
    private static final String QUAL_VPOOR = "Very Poor";
    private static final String QUAL_EXCEL = "Excellent";
    private static final String QUAL_UNDEF = "Quality Undefined";

    /**
     * getInvStock() Method:
     * Returns invStock - Current Inventory in Stock
     *
     */
    public int getInvStock() {
        return invStock;
    }

    /**
     * setInvStock() Method:
     * Sets invStock to specified value
     * @param invStock The Current Inventory in stock
     */
    public void setInvStock(int invStock) {
        this.invStock = invStock;
    }

    /**
     * getInvName() Method:
     * Returns invName - The name of the Inventory Item.
     *
     */
    public String getInvName() {
        return this.invName;
    }

    /**
     * setInvName() Method:
     * Sets invName to specified value
     * @param invName The name of the Inventory Item
     */
    public void setInvName(String invName) {
        this.invName = invName;
    }

    /**
     * getInvReqd() Method:
     * Returns invAmount - The Number of the Inventory Item required for the Product.
     *
     */
    public int getInvReqd() {
        return invRequired;
    }

    /**
     * setInvReqd() Method:
     * Sets invAmount to the specified value
     * @param amount The number of the specified Inventory Items required
     */
    public void setInvReqd(int amount) {
        this.invRequired = amount;
    }

    /**
     * getInvUnits() Method:
     * Returns invUnits - The units of the specific inventory item.
     *
     */
    public String getInvUnits() {
        return invUnits;
    }

    /**
     * setInvCost() Method:
     * Sets invCost to the correct cost/unit for the given inventory item.
     * @param units The units for the specific Inventory Item
     */
    public void setInvCost(double cost) {
        this.invCost = cost;
    }

    /**
     * getInvCost() Method:
     * Returns invCost - the cost/unit of the item.
     *
     */
    public double getInvCost() {
        return invCost;
    }

    /**
     * setInvUnits() Method:
     * Sets invUnits to the specified value
     * @param units The units for the specific Inventory Item
     */
    public void setInvUnits(String units) {
        this.invUnits = units;
    }

    /**
     * void setInvQuality(int qual) Method:
     * Sets the invQuality to the specified value
     * @param The integer value representing the quality, ranging from 0 (very poor) to 5 (excellent)
     */
    public void setInvQuality(int qual) {
        this.invQuality = qual;
    }

    /**
     * int getInvQuality() Method:
     * Used to determine the quality of the current inventory item
     * @return Returns the integer value of the inventory item quality
     */
    public int getInvQuality() {
        return this.invQuality;
    }

    /**
     * String getInvQuality() Method:
     * Used to determine the quality of the current inventory item
     * @return Returns the string representation of the inventory item quality
     */
    public String getInvQualityText() {
        switch (invQuality) {
            case 0:
                return QUAL_VPOOR;
            case 1:
                return QUAL_POOR;
            case 2:
                return QUAL_AVG;
            case 3:
                return QUAL_GOOD;
            case 4:
                return QUAL_VGOOD;
            case 5:
                return QUAL_EXCEL;
            default:
                return QUAL_UNDEF;
        }
    }
}
